package com.beverages.messages.client;

import com.beverages.messages.common.Result;
import com.beverages.messages.config.FeignOkHttpConfig;
import com.beverages.messages.entity.intermediate.Individual;
import com.beverages.messages.entity.dto.intermediate.IndividualDTO;
import feign.Headers;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "customer-individual-service", url = "${customer.individual.service.url}", configuration = FeignOkHttpConfig.class)
public interface CustomerIndividualClient {

    @GetMapping("/customer/individual/id/{individualId}")
    Result<IndividualDTO> getIndividualDTOById(@PathVariable("individualId") Integer individualId);

    @PostMapping("/customer/individual")
    Result saveIndividual(@RequestBody Individual individual);

    @GetMapping("/customer/individual/{individualId}")
    Result<Individual> getIndividualById(@PathVariable("individualId") Integer individualId);
}
